package com.cskaoyan.app.wxcontroller;

import com.cskaoyan.app.bean.bo.WxCollectBo;
import com.cskaoyan.app.bean.common.BaseRespVo;
import com.cskaoyan.app.bean.common.CommonData;
import com.cskaoyan.app.wxservice.WxCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author: 廖平安
 * @CreateTime: 2023-01-02  15:47
 * @Description: TODO
 * @Version: 1.0
 */
@RequestMapping("wx/collect")
@RestController
public class WxCollectController {
    @Autowired
    private WxCollectService collectService;

    @GetMapping("list")
    public BaseRespVo<CommonData<WxCollectBo>> list(Integer type, Integer page, Integer limit) {

        CommonData<WxCollectBo> data = collectService.list(type, page, limit);
        return BaseRespVo.ok(data);
    }

    @PostMapping("addordelete")
    public BaseRespVo addOrDelete(@RequestBody Map map) {
        collectService.addOrDelete(map);
        return BaseRespVo.ok();
    }
}
